<?php


namespace app\api\middleware;


use app\admin\model\SystemErrorLog;
use app\common\traits\JumpTrait;
use think\Request;
/**
 * 登录验证
 * Class TokenCheck
 * @package app\wechat\middleware
 */
class ClientCheck
{
    use JumpTrait;

    public function handle(Request $request, \Closure $next)
    {
        $client_type = get_ua();
        if ($client_type == 'alipay') {//支付宝授权
            session('client_type', 'alipay');
        } elseif ($client_type == 'wechat') {//微信授权
            session('client_type', 'wechat');
        } else {
            session('client_type', 'other');
        }
        return $next($request);
    }


}